LearningDataModel.CreateInteractionObjective Method

Creates a InteractionObjective object, which may then be used to be added to the Interaction.Objectives list.

Parent Type: LearningDataModel

Namespace: Microsoft.LearningComponents.DataModel

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public InteractionObjective CreateInteractionObjective ()

Return Value

A new InteractionObjective object associated with this LearningDataModel.

Exceptions
Exception type Condition
InvalidOperationException

Thrown if this LearningDataModel object cannot be written to.

Example

The following example demonstrates creating a new interaction objective and adding it to the Interaction.Objectives collection.

C#
LearningSession session = ... ; // get LearningSession object

InteractionObjective o = session.CurrentActivityDataModel.CreateInteractionObjective();
o.Id = "objective1"; // A unique identifier is required before this is added to the list
session.CurrentActivityDataModel.Interactions[0].Objectives.Add(o);